package com.example.novelstory.entity;

//import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@TableName("user")
@NoArgsConstructor //生成无参构造函数
@AllArgsConstructor //生成全参数构造函数
@ApiModel(value = "用户信息")
//mybatisplus会把类名User当成表名
public class User {
    // mp 会自动识别pojo类中名为id的属性，如果名字叫id就会当做是主键
    // 如果你的注解没有赋值那它会帮你使用ID_WORKER生成策略

    @ApiModelProperty("用户ID")
    @TableId(type = IdType.AUTO)
    private int id;//@TableId表示主键，与字段名称大小写一致
    @ApiModelProperty("用户名字")
    private String username;
    @ApiModelProperty("用户电话号")
    @TableField("telephone")
    private String telephone;
    @ApiModelProperty("用户邮箱")
    private String email;
    @ApiModelProperty("用户密码")
    private String password;//与字段名称大小写一致
    @ApiModelProperty("用户性别")
    private String sex;
    @ApiModelProperty("省份")
    private String province;//与字段名称大小写一致
    @ApiModelProperty("城市")
    private String city;//与字段名称大小写一致
    @ApiModelProperty("国家")
    private String country;//与字段名称大小写一致
    @ApiModelProperty("头像")
    private String headimgurl;
    @ApiModelProperty("介绍")
    private String introduce;
    @ApiModelProperty("用户会员状态")
    private byte status;//yinyint
    @ApiModelProperty("登录次数")
    private int login;
    @ApiModelProperty("用户登录ip")
    private long login_ip;//bigint
    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @ApiModelProperty("最后登录时间")
    private Date login_time;
    @ApiModelProperty("经验")
    private int exp;
    @ApiModelProperty("积分")
    private int integral;
    @ApiModelProperty("推荐票")
    private byte recommend;//

    //
//    public User(String id, String username, String password, Timestamp birthday, String photo, String introduce, String usertype) {
//        this.id = id;
//        this.username = username;
//        this.password = password;
//        this.birthday = birthday;
//        this.photo = photo;
//        this.introduce = introduce;
//        this.usertype = usertype;
//    }
//
//    public String getId() {
//        return id;
//    }
//
//    public void setId(String id) {
//        this.id = id;
//    }
//
//    public String getUsername() {
//        return username;
//    }
//
//    public void setUsername(String username) {
//        this.username = username;
//    }
//
//    public String getPassword() {
//        return password;
//    }
//
//    public void setPassword(String password) {
//        this.password = password;
//    }
//
//    public Timestamp getBirthday() {
//        return birthday;
//    }
//
//    public void setBirthday(Timestamp birthday) {
//        this.birthday = birthday;
//    }
//
//    public String getPhoto() {
//        return photo;
//    }
//
//    public void setPhoto(String photo) {
//        this.photo = photo;
//    }
//
//    public String getIntroduce() {
//        return introduce;
//    }
//
//    public void setIntroduce(String introduce) {
//        this.introduce = introduce;
//    }
//
//    public String getUsertype() {
//        return usertype;
//    }
//
//    public void setUsertype(String usertype) {
//        this.usertype = usertype;
//    }
//
//    @Override
//    public String toString() {
//        return "User{" +
//                "id='" + id + '\'' +
//                ", username='" + username + '\'' +
//                ", password='" + password + '\'' +
//                ", birthday=" + birthday +
//                ", photo='" + photo + '\'' +
//                ", introduce='" + introduce + '\'' +
//                ", usertype='" + usertype + '\'' +
//                '}';
//    }
}
